package com.dc.aimc.common.service.handler;

import com.dc.aimc.common.service.response.JsonResponse;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;


@ControllerAdvice
public class GlobalExceptionHandler {

    @ResponseBody
    @ExceptionHandler(value = Exception.class)
    public JsonResponse<String> exceptionHandler(Exception e) {
        return JsonResponse.fail(500, e.getMessage());
    }
}
